package com.example.testscalaandroid2.act

import org.scaloid.common.SActivity
import org.scaloid.common._
import android.view.{ Menu => MN }
import com.example.testscalaandroid2.R
import android.view.MenuItem
//scaloid支持不好 没找api
class Menu extends SActivity {

  override def onCreateOptionsMenu(menu: MN) = {
    super.onCreateOptionsMenu(menu)
    menu.add(0, 1, 0, "start")
    menu.add(0, 2, 0, "cancle")
    val file = menu.addSubMenu(0, 3, 0, "about")
    getMenuInflater().inflate(R.menu.menu, file)
    true
  }

  override def onOptionsItemSelected(item: MenuItem) = {
    this.setTitle(item.getTitle())
    true
  }

}
